<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title>员工信息</title>
        <link href="css/index_html.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id='con'>
        <h1>员工信息列表</h1>
        <form action="" method="get">
                   <input type="text" placeholder="请输入搜索关键字"  value="<?php echo $search; ?>" name="search"/>
                   <input type='submit' value="搜索" />
                <div style='position: fixed;top:43px;right:840px;'>
                <?php
                if ($login)
                {
                    echo "{$userinfo['username']}您好！<a href='logout.php'>注销</a>";
                }
                
                ?>
                </div>
        </form>
        <table border="1px" bordercolor="blue" >

            <tr>
                <th>ID</th>
                <th>姓名</th>
                <th>所属部门</th>
                <th>头像</th>
                <th>出生日期</th>
                <th>入职时间</th>
                <th>相关操作</th>
            </tr>
            <?php 
            foreach ($rows as $key) {                 
              ?>
            <tr>
                <th><?php echo $key["e_id"] ?></th>
                <td><?php echo $key["e_name"] ?></td>
                <td><?php echo $key["e_dept"] ?></td>
                <td><img src="<?php echo $key["e_img"] ?>"/></td>
                <td><?php echo $key["date_of_birth"] ?></td>
                <td><?php echo $key["date_of_entry"] ?></td>
                <td class="de"><a href="javascript:" onclick="if(confirm('编辑吗？')) location.href='bbs.php?id=<?php echo $key["e_id"] ?>'">编辑</a>　
                    <a  href="javascript:" onclick="if(confirm('确定删除吗？')) location.href='bbsDel.php?id=<?php echo $key["e_id"] ?>'">删除</a></td>
            </tr>
            <?php  } ?>

            <tr id="gg">
                    <?php 
                      $shang=(($pg-1)<=0)?1:($pg-1);
                      $xi=(($pg+1)>$wei)?$wei:($pg+1);
                    ?>
                    
                <td><a href="index.php?pg=1">首页</a></td>
                <td><a href="index.php?pg=<?php echo $shang ?>">上一页</a></td>
                <td><a href="index.php?pg=<?php echo $xi ?>">下一页</a></td>
                <td class="last"><a href="index.php?pg=<?php echo $wei ?>">尾页</a></td>
                <td>当前第<?php echo $pg ?>页</td>
                <td>共<?php echo $wei ?>页</td>
                <td>共<?php echo $sum ?>人</td>
            </tr>
        </table>
        <div id="di">
        <h1>添加员工</h1>
    <form action="dd.php" method="post">
        <table border="1px" bordercolor="blue">  
            <tr>
                <th>姓名：</th>
                <td><input type="text" name="e_name"></td>
            </tr>
            <tr>
                <th>所属部门：</th>
                <td><input type="text" name="e_dept"></td>
            </tr>
            <tr>
                <th>头像：</th>
                <td>
                    <input type="radio" name="e_img" value="images/1.jpg"><img src='images/1.jpg'>
                    <input type="radio" name="e_img" value="images/2.jpg"><img src='images/2.jpg'>
                    <input type="radio" name="e_img" value="images/3.jpg"><img src='images/3.jpg'>
                    <input type="radio" name="e_img" value="images/4.jpg"><img src='images/4.jpg'>
                </td>
            </tr>
            <tr>
                <th>出生日期：</th>
                <td><input type="datetime-local" name="date_of_birth"></td>
            </tr>
            <tr>
                <th>入职日期：</th>
                <td><input type="datetime-local" name="date_of_entry"></td>
            </tr>
        </table>
                <div id="er">
                    <ul>
                    <input type="reset" value="从新输入">
                    <input type="submit" value="确定输入">
                    </ul>
                </div>
    </form>
        </div>
    </div>
    </body>
</html>
